package com.anjubao.parking.municipal.roadside.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author zhangyunbo
 * @date 2019/6/27 14:24
 */
@Getter
@AllArgsConstructor
public enum SystemTypeEnum {
    EnclosedParking(1, "封闭式停车场"),
    RoadSide(2, "路边停车场");

    private Integer code;

    private String desc;

    public static String getDescByCode(Integer code) {
        for (SystemTypeEnum e : SystemTypeEnum.values()) {
            if (e.getCode().equals(code)) {
                return e.getDesc();
            }
        }
        return null;
    }

    public static Boolean exist(Integer code) {
        for (SystemTypeEnum e : SystemTypeEnum.values()) {
            if (e.getCode().equals(code)) {
                return true;
            }
        }
        return false;
    }
}